﻿/*
* This software is the confidential and proprietary
* information of NetBay
* Such confidential information should not be disclosed
* NetBay copyright(c) 2010
*/

#region Using

using NetBay.Core.BusinessEntities;
using System;
using Rio.Doc.DataAccess;

#endregion

namespace Rio.Doc.Business.Repository
{
    public class AdministrationRepository
    {
        /// <summary>
        /// Update a status of an application on a computer
        /// </summary>
        /// <param name="p_sComputerName">Computer name</param>
        /// <param name="p_sApplicationName">The application Name</param>
        /// <param name="p_sComputerIp">The application Ip Address</param>
        /// <param name="p_bApplicationInstalled">Does the application is installed</param>
        public static void UpdatePcApplicationStatus(string p_sComputerName, string p_sApplicationName, string p_sComputerIp, Boolean p_bApplicationInstalled)
        {
            DA_Administration.UpdatePcApplicationStatus(p_sComputerName, p_sApplicationName, p_sComputerIp, p_bApplicationInstalled);
        }

        /// <summary>
        /// Update a status of an application on a computer
        /// </summary>
        /// <param name="p_sComputerName">Computer name</param>
        /// <param name="p_sApplicationName">The application Name</param>
        /// <returns> A ReturnBoolean object corresponding to the status</returns>
        public static ReturnBoolean GetPcApplicationStatus(string p_sComputerName, string p_sApplicationName)
        {
            var l_oRet = new ReturnBoolean();

            try
            {
                // Retreives The alert Id newly created
                l_oRet.Value = DA_Administration.GetPcApplicationStatus(p_sComputerName, p_sApplicationName);
            }
            catch (Exception ex)
            {
                l_oRet = new ReturnBoolean("GetPcApplicationStatus(p_sComputerName<" + p_sComputerName + "> p_sApplicationName<" + p_sApplicationName + ">)", ex);
                NetBay.Core.Log.LogManager.Instance().LogError(l_oRet.FullErrorMessage);
            }
            return l_oRet;
        }
    }
}
